<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>Facelet Title</title>
        
    </h:head>
    
    <h:body>
        <ui:composition template="../../admin/adminTemplate.xhtml">
            
            <ui:define name="title">
                Admin Schema
            </ui:define>
            <ui:define name="page">
                
                <h1 class="pageheader"> Skapa en ny middagsrätt</h1>
                
              <div class="frm">
        <h:form class= "frm">
            
            <h:messages style="color:red;margin:8px;" />
            Namn på rätt: <h:inputText value="#{createDinner.dinnerName}" ></h:inputText> 
            Beskrivning: <h:inputText value="#{createDinner.dinnerDescription}" ></h:inputText>
            Pris: <h:inputText value="#{createDinner.dinnerPrice}"></h:inputText>
            
            Speciell ingrediens: <h:selectOneMenu value="#{createDinner.itemId}" id = "special">  
                  <f:selectItem itemLabel="välj" itemValue=""/>
                  <f:selectItems value="#{listSpecIngredients.getDinnerIngredients()}" var="c" itemValue="#{c.item_id}" itemLabel="#{c.item_name}"/>
                    </h:selectOneMenu>
           
            
        Middags typ: <h:selectOneMenu id = "dinnerType" value="#{createDinner.dinnerType}" >
                        
                    <f:selectItem itemLabel="välj" itemValue=""/>
                    <f:selectItem itemValue="dessert" itemLabel="Efterrätt" />
                    <f:selectItem itemValue="Main Course" itemLabel="Varmrätt" />
                    <f:selectItem itemValue="apetizer" itemLabel="Förrätt" />
    
                </h:selectOneMenu>
 
           <h:commandButton value ="spara" action = "#{createDinner.add()}"></h:commandButton>
        </h:form></div>
               </ui:define>
        </ui:composition>
        
    </h:body>
</html>

